<?php


namespace app\admin\model;


class TagModel extends BaseAdminModel
{
    protected $table = "blog_admin_tag";

    /**
     * 通过id获取对应的icon_url
     * @param int $id
     * @return mixed|string
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getTagImageById(int $id)
    {
        $result =  $this->find($id);
        if($result === null) {
            return '';
        }
        $arr = $result->toArray();
        return $arr['icon_url'];
    }
}